package com.to.aboomy.bannersample.pagetransformer;

import com.to.aboomy.banner.BannerViewPager;
import ohos.agp.components.Component;
import ohos.agp.components.DirectionalLayout;
import ohos.agp.components.StackLayout;

import static ohos.agp.components.Component.FOCUS_PREVIOUS;

/**
 * @author xujianhong
 * @since 2021-08-06
 */
public class StackTransformer implements BannerViewPager.PageTransformer{
    @Override
    public void transformerPage(BannerViewPager.PageType pageType, Component page, float offset, float offsetPixels) {

        switch (pageType) {
            case PREVIOUS:

                break;
            case CURRENT:
//                if (offsetPixels >= 0) {
//                    page.setTranslationX(-page.getWidth() * offset);
//                }else{
//                    page.setTranslationX(0.0F);
//                }
                break;
            case NEXT:
                break;
            case OTHER:
                page.setTranslationX(0F);
                break;
        }
    }
}
